package com.ld.admin.model.system;

import java.util.List;

import javax.validation.constraints.NotBlank;

import com.ld.shieldsb.annotation.field.DealField.Field;
import com.ld.shieldsb.annotation.field.db.ColumnName;
import com.ld.shieldsb.annotation.field.db.OnlyShow;
import com.ld.shieldsb.annotation.field.db.Unique;
import com.ld.shieldsb.annotation.model.ModelAnno.Model;
import com.ld.shieldsb.annotation.model.ModelAnno.TableName;
import com.ld.shieldsb.common.web.model.BasicIdEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 
 * 系统菜单(sys_menu)
 * 
 * @ClassName SysMenuModel
 * @author <a href="mailto:donggongai@126.com" target="_blank">吕凯</a>
 * @date 2019年01月09日 14:31:54
 *
 */
@Model(name = "系统菜单")
@TableName("sys_menu")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SysMenuModel extends BasicIdEntity {
    private static final long serialVersionUID = -1775937556965736086L;

    /*主键*/
    private Long id;
    /*菜单名称*/
    @NotBlank // 非空校验
    @Field(name = "菜单名称")
    private String name;
    /*链接*/
    @Field(name = "链接")
    @NotBlank // 非空校验
    private String href;
    /*父级编号*/
    private Long parentId;
    /*本级排序号（升序）*/
    private Integer sort;
    @Field(name = "页面显示的id")
    /*该字段值不能 重复,如果联合其他字段验证则增加compsite*/
    @Unique
    @NotBlank // 非空校验
    private String pageId;
    /*页面显示的class*/
    private String pageClass;
    @Field(name = "标题")
    private String title;
    /*是否最末级*/
    @ColumnName("tree_leaf")
    private String treeLeaf;
    /*层次级别*/
    @ColumnName("tree_level")
    private Integer treeLevel;
    /*全节点名*/
    @ColumnName("tree_names")
    private String treeNames;
    /*菜单类型（1菜单 2按钮 3开发）*/
    private Integer type;
    /*目标*/
    private String target;
    /*图标*/
    private String icon;
    /*颜色*/
    private String color;
    /*是否需要权限，0不需要1需要2登录后无需权限*/
    private Integer permType;
    /*菜单权重*/
    private Integer weight;
    /*是否显示（1显示 0隐藏）*/
    @ColumnName("is_show")
    private Integer isShow;
    /*归属系统（default:主导航菜单、mobileApp:APP菜单）*/
    @ColumnName("sys_code")
    private String sysCode;
    /*归属模块（多个用逗号隔开）*/
    @ColumnName("module_codes")
    private String moduleCodes;
    /*备注信息*/
    private String remarks;
    /*操作权限:U修改(update)D删除(delete)*/
    private String operation;
    /*创建人姓名*/
    private String createName;
    /*修改人姓名*/
    private String updateName;

    @OnlyShow
    /*子菜单*/
    private List<SysMenuModel> childMenus;
}
